package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: qian
 * Date: 2022-12-28
 * Time: 16:23
 */

//使用lambda表达式写法
public class Demo5 {
    public static void main(String[] args) {
        Thread t=new Thread(()->{
            while(true){
                System.out.println("hello thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        t.start();
    }
}
